<template>
    <div>
      <div v-for="item in comments" :key="item.id">
        <h3>{{item.userId}}</h3>
        <hr>
        <div class="content" v-html="item.content"></div>
      </div>
    </div>
</template>

<script>
  import cmt from "../../components/subcomponents/comment"
  export default {
    name: 'goodsComment',
    // components: {
    //   cmt
    // },
    data() {
      return {
        id:this.$route.params.id,
        comments:{}
      }
    },
    created () {
      this.getComment();
    },
    methods: {
      getComment(){
        var $this=this;
        this.axios({
        method:'get',
        url: "http://localhost:8083/comment/list",
        params:{valueId:this.id}
      }).then(function(res){
          console.log("查询的商品评论",res);
          $this.comments=res.data.obj.list;
      });
      }
  }
  }
</script>

<style lang="scss">
  .goods-desc {
    padding: 4px;
    h3 {
      font-size: 16px;
      color: #226aff;
      text-align: center;
      margin: 15px 0;
    }
    .content {
      img {
        width: 100%;
      }
    }
  }

</style>
